package com.bicon.botu.mall.base.api;

import com.bicon.botu.mall.base.common.MallHomePageConstants;
import com.bicon.botu.mall.base.entity.HomeIcon;
import com.bicon.botu.mall.base.service.IHomeIconService;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 首页图标 前端控制器
 *
 * @author 张凡
 * @date 2017/7/19 下午 14:49
 */
@RestController
@CrossOrigin
@RequestMapping("/V1.0.0/api/homeIcon")
public class HomeIconApi extends BaseController {
    @Autowired
    IHomeIconService iHomeIconService;

    /**
     * 获取首页图标详情
     *
     * @return
     */
    @RequestMapping(value = "/getHomeIconDetailFromRedis", method = RequestMethod.GET)
    public BaseResult getHomeIconDetailFromRedis() {
        List<HomeIcon> homeIcons = iHomeIconService.getHomeIconDetailFromRedis();
        return new BaseResult(MallHomePageConstants.RESPONSE_CODE_200, MallHomePageConstants.RESPONSE_MESSAGE_200, homeIcons);
    }
}
